package top.eggcode.job;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import top.eggcode.service.AppService;

import javax.annotation.Resource;

@Component
@Configurable
@EnableScheduling
public class AppMonitorJob {

    @Resource
    private AppService appService;

    @Transactional
    @Scheduled(cron = "0 0/1 * * * ?")
    public void refreshStatus() {
        appService.checkAll();
    }
}
